<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<fmt:setBundle basename="messages" />
</head>
<body>
<%@ include file="head.jsp"%>
<form action="/CA_Project/AdminList" method="POST" >
<table id="t1" border="1" width="500" >
 <tr>
 <td width="150px" align=center>User ID</td>
 <td align=center width="150px">
 <input type="text" id="userid" name="userid"  maxlength="20" /></td>
 <td align=center width="150px">
 	<input type="submit" name = "Search" value="Search"/></td>
 <td width="150px"></td>
 <td width="150px"></td>
 </tr>
 <tr>
	<td width="150px"> UserID </td>
	<td width="150px"> UserName </td>
	<td width="150px"> Domain </td>
	<td width="150px"> AnnualLeave</td>
	<td width="150px"> MedicalLeave</td>			
 </tr>
<c:choose>
	<c:when test = "${AfterSearch}">
				<tr>
					<td width="150px"><input type="text" name="UserID" value="${alluser._userID}"
					size=15 maxlength=20></td>
					<td width="150px">${alluser._name}</td>
					<td width="150px">${alluser._domain}</td>
					<td width="150px"><input type="text" name="AnnualLeave" value="${alluser._annualLeaveEntitlement}"
					size=15 maxlength=20></td>
					<td width="150px"><input type="text" name="MedicalLeave" value="${alluser._medicalLeaveEntitlement}"
					size=15 maxlength=20></td>
				</tr>	
	</c:when>
	<c:otherwise>
		 <c:forEach var="user" items="${alluser}" varStatus="status">
				<tr>
					<td width="150px"><input type="text" name="UserID" value="${user._userID}"
					size=15 maxlength=20></td>
					<td width="150px">${user._name}</td>
					<td width="150px">${user._domain}</td>
					<td width="150px"><input type="text" name="AnnualLeaveMulti" value="${user._annualLeaveEntitlement}"
					size=15 maxlength=20></td>
					<td width="150px"><input type="text" name="MedicalLeaveMulti" value="${user._medicalLeaveEntitlement}"
					size=15 maxlength=20></td>
				</tr>
		</c:forEach>		
	</c:otherwise>
</c:choose>

 </table>
 
 <table>
 <tr>
 <td width="150px">
 </td>
 <td width="150px">
 </td>
 <td width="150px">
 </td>
 <td width="150px">
 </td>
 <td align=center width="150px">
 
 <input type="submit" name = "Update" value="Update" ></td>
 </tr> 
 </table>
</form>
</body>
</html>